package com.JohnCarloSalter.BackEnd;

public class Invoker {
	final private static Aggregator aggregator = new Aggregator();
	
	public static String invokeDisplayMenu() {
		return new CMD_DisplayMenu(aggregator).execute();
	}
	
	public static void invokeSubmitOrder(int itemNumber) throws Exception {
		try {
			if(!(Boolean)(new CMD_SubmitOrder(aggregator, itemNumber).execute())) {
				throw new Exception("The item you have selected does not exist.");
			}
		} catch (Exception eRef) {
			System.err.println(eRef.getMessage());
		}
	}
	
	public static String invokeDisplayTab() {
		return new CMD_DisplayTab(aggregator).execute();
	}
}
